package com.parking.platform.form;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/***
 * 添加平台账号
 * 参数：
 ("平台账号")：platformAccount;
 ("平台密码")：platformPass;
 ("平台角色id")：platformRoleId;
 */
@ApiModel("新增平台账号")
@Data
public class AddPlatformDataForm {
    /***
     ("平台账号")：platformAccount;
     */
    @Size(max = 20, message = "用户账号长度不能超过20位")
    @Pattern(regexp = "^[a-zA-Z0-9]*$", message = "用户账号只能包含字母或数字")
    @ApiModelProperty("平台账号")
    private String platformAccount;
    /***
     ("平台密码")：platformPass;
     */
    @ApiModelProperty("平台密码")
    @Length(min = 6,max = 12,message = "密码长度错误6到12位")
    private String platformPass;

    /***
     ("平台角色id")：platformRoleId;
     */
    @ApiModelProperty("平台角色id")
    @Digits(integer = 10, fraction = 0, message = "platformRoleId必须是整数")
    private Integer platformRoleId;
}
